#pragma once
#include "li_collections.h"

// alloc a memory for saving args
Li_List _new_args_array();
// push a  string in str-args
int _push_arg_str(Li_List v, str s, int n);
// add a instruction, given argn and args
int _push_ins(Li_List ins, Li_List args, uint16_t opeCode, int argn, ...);
// add a instruction, given argn
int _push_ins2(Li_List ins, Li_List args, uint16_t opeCode, int argn);
// add to args-list
int _push_args(Li_List args, int argn, ...);
// add a word-data to args-list
int _push_args2(Li_List args, Any data);
// add a object to args-list
int _push_args3(Li_List args, Any _data, int size);
#define _push_args_obj(args, data) (_push_args3(args, (Any)(data), sizeof(data)))
int32_t *pack_up(Li_List ins, Li_List args, Li_List ext, int *out_errcode);
int compile_single(const char *rx, int len, Li_List ins, Li_List args, void *ptr_ext);
int *compile_all(const str rx, int len);
